package com.shopcart.repository;



import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;

import com.shopcart.domain.StoreComment;


@RestResource(exported = false)
public interface StoreCommentRepository extends CrudRepository<StoreComment, String> {

	Page<StoreComment> findByStoreId(String storeId,Pageable p);
	
	@Query("select count(1) from StoreComment where storeId = ?1")
	int commentCount(String storeId);
	
}
